package com.itheima.date;

import java.util.Date;

public class DateDemo1 {
    public static void main(String[] args) {
        //获取当前电脑的显示时间
        Date d = new Date();
        System.out.println(d);
        long time = d.getTime();
        System.out.println(time);
        long tenYearsAgo = time - 315360000000L;
        //获取十年前的时间
        d.setTime(tenYearsAgo);
        System.out.println(d);
    }
}
